﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="ConvertCustomProvider" xmlns="http://schemas.microsoft.com/pag/gax-core" xmlns:xi="http://www.w3.org/2001/XInclude" Bound="false">
  <DocumentationLinks>
    <Link Kind="Documentation" Caption="Creating Providers" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-060-Creating_Providers.htm" />
    <Link Kind="Documentation" Caption="How To: Convert Untyped Providers to Typed Providers" Url="ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-110-How_To_Convert_Untyped_Providers_to_Typed_Providers.htm" />
    <Link Kind="NextStep" Caption="Create Design-Time Provider Node" Url="recipe://CreateDesignTimeNode" />
  </DocumentationLinks>
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>Convert Untyped Provider to Typed Provider</Caption>
  <Description>Converts an existing untyped provider into a typed provider, and creates a configuration class for the provider.</Description>
  <HostData>
    <CommandBar Menu="EnterpriseLibraryProjectItemMenu"/>
  </HostData>

  <Arguments>
    <Argument Name="CurrentProject" Type="Project">
      <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />
    </Argument>
    <Argument Name="CustomProvider" Type="ProjectItem">
      <ValueProvider Type="CurrentItemProvider" />
    </Argument>
		<Argument Name="ProviderName">
			<ValueProvider ProjectItem="CustomProvider" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.ValueProviders.ProjectItemTypeName, Microsoft.Practices.EnterpriseLibrary.BlockFactory" >
			</ValueProvider>
		</Argument>
		<xi:include href="..\Common\CommonTextTemplate.xml"
		xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Arguments/gax:Argument)" />
	</Arguments>
	<Actions>
    <Action Name="ConvertCustomProvider" Type="Microsoft.Practices.EnterpriseLibrary.BlockFactory.Actions.EnterpriseLibrary.ConvertCustomProvider, Microsoft.Practices.EnterpriseLibrary.BlockFactory">
      <Input  Name="CustomProvider" RecipeArgument="CustomProvider" />
      <Output Name="ConfigurationClassname"/>
      <Output Name="ProviderName"/>
      <Output Name="Namespace"/>
      <Output Name="ExtendedNamespace"/>
      <Output Name="RuntimeClassName"/>
    </Action>
    <Action  Name="CreateProviderInfo" 
             Type="CreateProviderInfo"
             ProviderDataSuffix="Data">
      <Input Name="Namespace" ActionOutput="ConvertCustomProvider.Namespace" />
      <Input Name="ExtendedNamespace" ActionOutput="ConvertCustomProvider.ExtendedNamespace" />
      <Input Name="ProviderName" ActionOutput="ConvertCustomProvider.ProviderName" />
      <Input Name="ConfigurationClassName" ActionOutput="ConvertCustomProvider.ConfigurationClassname" />
      <Input Name="RuntimeProviderRootType" ActionOutput="ConvertCustomProvider.RuntimeProviderRootType" />
      <Input Name="RuntimeProviderBaseType" ActionOutput="ConvertCustomProvider.RuntimeProviderBaseType" />
      <Input Name="RuntimeConfigurationBaseType" ActionOutput="ConvertCustomProvider.RuntimeConfigurationBaseType" />
      <Output Name="DefaultRuntimeImplementationTemplate" />
      <Output Name="ProviderInfo" />
    </Action>
    <xi:include href="..\Common\CommonProvider.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Actions/gax:Action[@Name='GenerateProviderDataContent'])" />
    <xi:include href="..\Common\CommonProvider.xml"
      xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Actions/gax:Action[@Name='AddProviderData'])" />
		<xi:include href="..\Common\CommonTodoComments.xml"
			xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Recipe/gax:Actions/gax:Action)" />
	</Actions>
</Recipe>